
"ui";
var storage = storages.create("ABC");


var my_time1 = storage.get('my_time1');
if (my_time1 == undefined) {
    my_time1 = '1'
}

var my_time2 = storage.get('my_time2');
if (my_time2 == undefined) {
    my_time2 = '1'
}

var my_time3 = storage.get('my_time3');
if (my_time3 == undefined) {
    my_time3 = '1'
}

var my_time4 = storage.get('my_time4');
if (my_time4 == undefined) {
    my_time4 = '1'
}

var my_time5 = storage.get('my_time5');
if (my_time5 == undefined) {
    my_time5 = '1'
}

var my_time6 = storage.get('my_time6');
if (my_time6 == undefined) {
    my_time6 = '1'
}

var my_time7 = storage.get('my_time7');
if (my_time7 == undefined) {
    my_time7 = '1'
}

var my_time8 = storage.get('my_time8');
if (my_time8 == undefined) {
    my_time8 = '1'
}

var my_time9 = storage.get('my_time9');
if (my_time9 == undefined) {
    my_time9 = '1'
}

var my_content = storage.get('my_content');
if (my_content == undefined) {
    my_content = '话术a|话术b|话说c|话术d'
}

var my_name = storage.get('my_name');
if (my_name == undefined) {
    my_name = '抖音昵称'
}

xml ='<vertical padding="16">\
        <button id="ok" text="开始"/>\
        <text text="音量上键停止运行" textSize="40sp"  gravity="center"/>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="用户点击间隔/秒"/>\
        <input id="my_time1" inputType="number" text="' + my_time1 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="点击更多间隔/秒"/>\
        <input id="my_time2" inputType="number" text="' + my_time2 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="点击发私信间隔/秒"/>\
        <input id="my_time3" inputType="number" text="' + my_time3 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="到达聊天框间隔/秒"/>\
        <input id="my_time4" inputType="number" text="' + my_time4 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="输入话术间隔/秒"/>\
        <input id="my_time5" inputType="number" text="' + my_time5 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="点击发送间隔/秒"/>\
        <input id="my_time6" inputType="number" text="' + my_time6 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="退出私信页面间隔/秒"/>\
        <input id="my_time7" inputType="number" text="' + my_time7 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="退出个人主页间隔/秒"/>\
        <input id="my_time8" inputType="number" text="' + my_time8 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="粉丝列表停留间隔/秒"/>\
        <input id="my_time9" inputType="number" text="' + my_time9 + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="抖音昵称"/>\
        <input id="my_name" text="' + my_name + '"/>\
        </horizontal>\
        <horizontal>\
        <text textSize="16sp" textColor="black" text="私信话术"/>\
        <input id="my_content" text="' + my_content + '"/>\
        </horizontal>\
    </vertical>'

ui.layout(
    xml
);

//指定确定按钮点击时要执行的动作
ui.ok.click(function(){
    //通过getText()获取输入的内容
    toast("开始辣");
    var my_content = ui.my_content.text();
    var my_name = ui.my_name.text();
    var my_time1 = ui.my_time1.text();
    var my_time2 = ui.my_time2.text();
    var my_time3 = ui.my_time3.text();
    var my_time4 = ui.my_time4.text();
    var my_time5 = ui.my_time5.text();
    var my_time6 = ui.my_time6.text();
    var my_time7 = ui.my_time7.text();
    var my_time8 = ui.my_time8.text();
    var my_time9 = ui.my_time9.text();

    storage.put("my_content", my_content);
    storage.put("my_name", my_name);
    storage.put("my_time1", parseInt(my_time1));
    storage.put("my_time2", parseInt(my_time2));
    storage.put("my_time3", parseInt(my_time3));
    storage.put("my_time4", parseInt(my_time4));
    storage.put("my_time5", parseInt(my_time5));
    storage.put("my_time6", parseInt(my_time6));
    storage.put("my_time7", parseInt(my_time7));
    storage.put("my_time8", parseInt(my_time8));
    storage.put("my_time9", parseInt(my_time9));

    var path = '抖音粉丝私信.js'
    execution = engines.execScriptFile(path);
});
